<template>
    <div class="searchDetail">
      <p>热门搜索</p>
      <ul>
        <li v-for="(item, index) in hotSearchList" 
            @click="$emit('searchindex',item.first)"
            :key="index">
          {{ item.first }}
        </li>
      </ul>
    </div>
</template>
<script>
export default {
  name: "HotSearch",
  data() {
    return {
      hotSearchList: [],
    };
  },
  created() {
    this.$http
      .get("/search/hot/detail", {
        params: {
          id: this.id,
        },
      })
      .then((d) => {
        this.hotSearchList = d.data.result.hots;
      });
  },
  methods: {
    // add(e) {
    //   console.log(e);
    // },
  },
  components: {
  },
};
</script>
<style lang="less" scoped>
.searchDetail {
  padding: 15px 10px 0;
  p {
    margin-left: 8px;
    font-size: 12px;
    line-height: 12px;
    color: #666;
  }
  ul {
    margin: 10px 0 7px;
    overflow: hidden;
    li {
      display: inline-block;
      height: 32px;
      margin-right: 8px;
      margin-bottom: 8px;
      padding: 0 14px;
      font-size: 14px;
      line-height: 32px;
      color: #333;
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 20px;
    }
  }
}
</style>